<!--
 * @Author: your name
 * @Date: 2021-09-07 09:58:40
 * @LastEditTime: 2021-09-07 11:09:56
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day12\6-事件冒泡.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .outer {
            border: 1px solid royalblue;
            width: 300px;
            height: 300px;
        }
    </style>
</head>

<body>
    <div class=outer>

    </div>
</body>
<script>
    var outer = document.getElementsByClassName("outer")[0];
    outer.onclick = function() {
        console.log("outer");
        //阻止事件冒泡
        event.stopPropagation();
        console.log(event);
        //事件类型
        console.log(event.type);
        //事件是否冒泡
        console.log(event.bubbles);
        //是否可取消默认行为
        console.log(event.cancelable);
        //事件目标
        console.log(event.target);
    }
</script>

</html>